package javaCode.chapter07.Homework;

public class Homework15 {
    public static void main(String[] args) {
        AAA obj = new BBB(); //向上转型
        AAA a1 = obj;
        System.out.println("obj的运行类型=" + obj.getClass());
        obj = new CCC();
        System.out.println("obj的运行类型=" + obj.getClass());
        obj = a1;
        
    }
}

class AAA{}

class BBB extends AAA {}

class CCC extends BBB{}